import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

public class HadoopHdfsTest {
    static Configuration conf = new Configuration();
    static FileSystem fs;

    public static void main(String[] args) throws Exception{

        upload();
    }
    public static void upload() throws Exception{
        fs = FileSystem.get(conf);
        fs.copyFromLocalFile(false,new Path("G:/JJQ/test.txt"),new Path("/test.txt"));
        fs.close();
    }

    public static void down() throws Exception{
        fs = FileSystem.get(conf);
        fs.copyToLocalFile(false,new Path("/jjq.txt"),new Path("G:/JJQ/"),true);
        fs.close();
    }

}
